module Singly
  class Types
    include Singly::Endpoint

    endpoint :get, "/types", required: [:access_token]

    def photos(params={})
      types_endpoint(__method__, params)
    end

    def photos_feed(params={})
      types_endpoint(__method__, params)
    end

    def news(params={})
      types_endpoint(__method__, params)
    end

    def news_feed(params={})
      types_endpoint(__method__, params)
    end

    def videos(params={})
      types_endpoint(__method__, params)
    end

    def videos_feed(params={})
      types_endpoint(__method__, params)
    end

    def checkins(params={})
      types_endpoint(__method__, params)
    end

    def checkins_feed(params={})
      types_endpoint(__method__, params)
    end

    def statuses(params={})
      types_endpoint(__method__, params)
    end

    def statuses_feed(params={})
      types_endpoint(__method__, params)
    end

    def contacts(params={})
      types_endpoint(__method__, params)
    end

    def all(params={})
      types_endpoint(__method__, params)
    end

    def all_feed(params={})
      types_endpoint(__method__, params)
    end

    private

    def types_endpoint(type_name, params)
      params ||= {}
      Singly::Types::Type.new(creds.merge(params.merge({
        type: type_name.to_s
      })))
    end
  end
end